package GUI;
import com.cloudgarden.layout.AnchorLayout;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class Menu extends javax.swing.JFrame {
	

	{
		//Set Look & Feel
		try {
			javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
		} catch(Exception e) {
			e.printStackTrace();
		}
	}	      
			   
	private JMenuBar Menu;
	private JMenuItem Mfuncionario;
	private JLabel imagem;
	private JMenuItem Mfilme;
	private JPanel logo;
	private JMenuItem Sair;
	private JMenuItem Cliente;
	private JMenu Cadastros;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				Menu inst = new Menu();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public Menu() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
		this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
			this.setTitle("LokVideoJTP");
			this.setIconImage(new ImageIcon(getClass().getClassLoader().getResource("GUI/logo_lokvideo.png")).getImage());
			this.setName("frame0");
			{
				logo = new JPanel();
				CardLayout logoLayout = new CardLayout();
				logo.setLayout(logoLayout);
				getContentPane().add(logo, BorderLayout.CENTER);
				
				{;
				imagem = new JLabel(new javax.swing.ImageIcon("GUI/logo_lokvideo.png")); 
				
					logo.add(imagem, "imagem");
					AnchorLayout imagemLayout = new AnchorLayout();
					imagem.setLayout(imagemLayout);
					imagem.setPreferredSize(new java.awt.Dimension(710, 311));
					imagem.setOpaque(true);
				}

				       }  
			
			{
				Menu = new JMenuBar();
				setJMenuBar(Menu);
				{
					Cadastros = new JMenu();
					Menu.add(Cadastros);
					Cadastros.setText("Cadastros");
					{
						Cliente = new JMenuItem();
						Cadastros.add(Cliente);
						Cliente.setText("Cliente");
						Cliente.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent evt) {
								ClienteActionPerformed(evt);
								}
							}
						);
					}
					{
						Mfilme = new JMenuItem();
						Cadastros.add(Mfilme);
						Mfilme.setText("Filme");
						Mfilme.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent evt) {
								System.out.println("Mfilme.actionPerformed, event="+evt);
								GUICadastrarFilme GUIcadastrarFilme = new GUICadastrarFilme();
								GUIcadastrarFilme.setVisible(true);							}
						});
					}
					{
						Mfuncionario = new JMenuItem();
						Cadastros.add(Mfuncionario);
						Mfuncionario.setText("Funcionario");
						Mfuncionario.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent evt) {
								System.out.println("Mfuncionario.actionPerformed, event="+evt);
								GUICadastrarFuncionario GUIcadastrarFuncionario = new GUICadastrarFuncionario();
								GUIcadastrarFuncionario.setVisible(true);							
								}							}
						);
					}
					{
						Sair = new JMenuItem();
						Cadastros.add(Sair);
						Sair.setText("Sair");
						Sair.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent evt) {
								System.out.println("Sair.actionPerformed, event="+evt);
								System.exit(0);  }
						}
						);
					}
				}
			}
			
			
			pack();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}


	private void ClienteActionPerformed(ActionEvent evt) {
		System.out.println("Cliente.actionPerformed, event="+evt);
		GUICadastrarCliente cadastrarCliente = new GUICadastrarCliente();
		cadastrarCliente.setVisible(true);
		
	}

}
